# Contributor: TBK <alpine@jjtc.eu>
# Maintainer: TBK <alpine@jjtc.eu>
pkgname=php7-maxminddb
_pkgreal=MaxMind-DB-Reader-php
pkgver=1.6.0
pkgrel=2
pkgdesc="PHP7 MaxMind DB Reader extension"
url="https://github.com/maxmind/MaxMind-DB-Reader-php"
arch="all"
license="Apache-2.0"
depends="php7-bcmath"
makedepends="libmaxminddb-dev php7-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/maxmind/MaxMind-DB-Reader-php/archive/v$pkgver.tar.gz"
builddir="$srcdir"/$_pkgreal-$pkgver/ext

build() {
	phpize7
	./configure --prefix=/usr \
		--with-php-config=/usr/bin/php-config7
	make
}

check() {
	make test NO_INTERACTION=1 REPORT_EXIT_STATUS=1
}

package() {
	make INSTALL_ROOT="$pkgdir/" install

	local confdir="$pkgdir/etc/php7/conf.d"
	install -d $confdir
	echo "extension=maxminddb.so" > $confdir/maxminddb.ini
}

sha512sums="e8c0ccf2cfcedf7527b4e3f858d2ed0e70add60692fff4a65f08e5cb885516b7c2a3ceaa3c21713369cd8ffca2b671d764063236de1d729cfc5173f7d5dd4607  php7-maxminddb-1.6.0.tar.gz"
